/*
 * player.hpp
 * This file is part of Quarto
 *
 * Copyright (C) 2012 - Ian Liu Rodrigues <ian.liu88@gmail.com>
 *
 * Quarto is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Quarto is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Quarto. If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef QUARTO_PLAYER_H_
#define QUARTO_PLAYER_H_

#include <string>
#include "piece.hpp"
#include "board.hpp"

namespace br_unicamp {

class PlayerStrategy {
 public:
  virtual ~PlayerStrategy(void);

  virtual const Piece* askPiece(const PieceBag&,
                                const Board&) = 0;

  virtual int askPlace(const PieceBag&,
                       const Board&,
                       const Piece&) = 0;
};

class Player {
 public:
  Player(const std::string& name,
         PlayerStrategy* strategy);

  virtual ~Player();

  const std::string& getName(void) const;

  const Piece* askPiece(const PieceBag&, const Board&);

  int askPlace(const PieceBag&, const Board&, const Piece&);

 private:
  std::string name;
  PlayerStrategy* strategy;
};

}

#endif  // QUARTO_PLAYER_H_
